package cn.kgc.tangcco.tcbd1011.no13.base.util;

public class Utils {
	
	//封装BaseServlet内的methodName为常量
	public static final String METHODNAME = "methodName";
	//封装一个判断是否是ajax方法，如果是，就不进行跳转与重定向
	public static final String AJAX = "ajax";
	
	//封装需要重定向的方法
	public static final String REDIRECEDOADD = "doAdd";
	public static final String REDIRECEDOUPDATE = "doUpdate";
	public static final String REDIRECEDODELETE = "doDelete";
	
	//封装Vehicle需要实例化的对象KEY
	public static final String VEHICLEDAO = "tcbd1011.no13_group.vehicleDao";
	public static final String VEHICLESERVICE = "tcbd1011.no13_group.vehicleService";
	
	//封装VehicleType需要实例化的对象KEY
	public static final String VEHICLETYPEDAO = "tcbd1011.no13_group.vehicleTypeDao";
	public static final String VEHICLETYPEService = "tcbd1011.no13_group.vehicleTypeService";
	
	//封装客户类
	public static final String CUSTOMERDAO = "tcbd1011.no13_group.customerDao";
	public static final String CUSTOMERSERVICE = "tcbd1011.no13_group.customerService";
	//封装品牌类
	public static final String VEHICLEBRANDDAO = "tcbd1011.no13_group.vehicleBrandDao";
	public static final String VEHICLEBRANDSERVICE = "tcbd1011.no13_group.vehicleBrandService";
	
	//封装用户类
	public static final String USERDAO="tcbd1011.no13_group.userDao";
	public static final String USERSERVICE="tcbd1011.no13_group.userService";
	//封装类型类
	public static final String TYPEDAO="tcbd1011.no13_group.typeDao";
	public static final String TYPESERVICE="tcbd1011.no13_group.typeService";
	
	
	
	
	
	//泛型打印方法
	public static <T>void println(T entity){
		System.out.println(entity);
	}
	//将页面传回的String类型转换为Int类型
	public static int parseInt(String pk) {
		int number = 0;
		if ( pk != null && !pk.isEmpty()) {
			number = Integer.parseInt(pk);
		}
		return number;
	}
}
